[Unit]
Documentation=https://openvoiceos.github.io/ovos-docker/about/glossary/components/#ovos-shell
Description=Open Voice OS - GUI
PartOf=ovos.service
Requires=ovos.service ovos-gui-websocket.service ovos-phal.service

[Service]
Environment="QT_QPA_PLATFORM={{ 'eglfs' if ovos_installer_display_server == "N/A" else 'wayland;xcb' }}"
Environment="QT_QPA_PLATFORMTHEME=qt5ct"
Environment="QT_QPA_EGLFS_KMS_ATOMIC=1"
Environment="QT_FONT_DPI=120"
Environment="QT_QUICK_CONTROLS_STYLE=OpenVoiceStyle"
Environment="QT_FILE_SELECTORS=ovos"
Environment="QT_QPA_EGLFS_HIDECURSOR=1"
{% if "Raspberry Pi 5" in ovos_installer_raspberrypi and ovos_installer_display_server == "N/A" %}
Environment="QT_QPA_EGLFS_INTEGRATION=eglfs_kms"
Environment="QT_QPA_EGLFS_KMS_CONFIG=%h/.config/ovos-eglfs.json"
{% endif %}
{% if 'tas5806' in ovos_installer_i2c_devices %}
Environment="QT_IM_MODULE=qtvirtualkeyboard"
{% endif %}
WorkingDirectory=%h/.venvs/ovos
ExecStart=/usr/bin/{{ 'ovos-shell' if ovos_installer_display_server == "N/A" else 'ovos-gui-app' }}
ExecReload=/usr/bin/kill -s HUP $MAINPID
ExecStop=/usr/bin/kill -s KILL $MAINPID
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=ovos.service
